<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include  file="/jsps/front/common/taglibs.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title>${good.goodsName} 商品信息</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		
		<link rel="stylesheet" type="text/css" href="<c:url value="/jsps/front/css/comm_answer.css"/>">
		<link rel="stylesheet" type="text/css" href="<c:url value="/jsps/front/css/good_show.css"/>">
		<link rel="stylesheet" type="text/css" href="<c:url value="/jsps/front/css/head.css"/>">
		 <link rel="stylesheet" type="text/css" href="<c:url value="/jsps/front/css/application.css"/>">
		

		<script type="text/javascript">
		
	 	function buy(goodCnt,goodNo){
	 		var goodNum=document.getElementById('goodNum').value;
           if(goodNum>goodCnt)
             alert("你所要购买的商品数量大于库存量，请重新输入!");
           else if(confirm("你确认要购买"+goodNum+"件"+"该商品吗?")){
             location.href='<c:url value="/goodMgr?act=addGoodToCart"/>&goodNo='+goodNo+'&goodNum='+goodNum;
             }  
	 	}

   </script>

	</head>

	<body style="background-color: #769b72;">
	         
	<c:import url="/jsps/front/head.jsp"/>
	
	    <div id="allcontent">
			<div id=main>
				<DIV class=mainsearch></DIV>
				<DIV class=wrap>
					<DIV class=left>
						<DIV class=left_div_yellow1>
							<H2 class=left_title>
								浏览本商品的顾客还看过
							</H2>
							<c:forEach var="book" items="${mostvisitedbooks}">
								<H3>
									<SPAN class=point>·</SPAN><A class=blue12a
										title="${book.bookName}"
										href="<c:url value='/#'/>"
										target=_blank></A>
								</H3>
								<DIV class=dashed></DIV>
							</c:forEach>

						</DIV>
						<DIV class=left_div_gray>
							<H2 class=left_title>
								您最近的浏览历史
							</H2>
							<c:forEach var="good" items="${thisvisitedgoods}">
								<H3>
									<SPAN class=point>·</SPAN><A class=blue12a
										title=""
										href="<c:url value='/#'/>"
										target=_blank></A>
								</H3>
								<DIV class=dashed></DIV>
							</c:forEach>

						</DIV>
					</DIV>
			<c:if test="${not empty good}">	
					<DIV class=right>
						<DIV class=right_wai>
							<DIV class=shuming>
								<DIV class=shuming_left>
									<SPAN style="font-size:30px;color:red;padding-left:15px;">
									  <B>商品名称:${good.goodsName}</B>&nbsp;&nbsp;
									 
									 </SPAN>
									<DIV class=empty_box></DIV>
								</DIV>
							</DIV>
							<DIV class=book_left>
								<DIV class=book_pic>
									 <img id=img style="width: 190px; height: 190px; align:center;" title="商品图片" 
							 src="<c:url value="/goodMgr?act=showGoodCover"/>&goodNo=${good.goodsNo}" border=0>
								</DIV>
							</DIV>
							 <button style="float:right;" onclick="history.go(-1)">返回</button>
							<DIV class=book_right>
								<DIV>
									商品编号：${good.goodsNo}
								</DIV>
								<DIV>
									是否缺货：
									<c:if test="${good.cnt<=10}">商品热销中 ...</c:if>
									<c:if test="${good.cnt>10}">库存充足...</c:if>
								</DIV>
								<div style="margin-top: 10px;">
								<DIV class=jiage>
									<SPAN class=gray87>单价: ${good.goodsPrice}元</SPAN>
								</DIV>
								<div class=buy>
						          <span>商品数量:</span>	
						           <input type="text" class="text" name="cnt" 
						                  id="goodNum" size=5 value="1"/> 
				        		</div>	
								<DIV class=goumai>
									<A title=购买 target="_blank"
										
										name=purchase_bk> 
									<IMG onclick="buy(${good.cnt },${good.goodsNo });"
									      src="<c:url value='/jsps/front/images/login/booksale.gif'/>" border=0> </A>
								</DIV>
								
							</DIV>
							<div style="padding: 10px;">
								摘要信息：
								<br />
								<br />
								&nbsp;&nbsp;&nbsp;&nbsp;${good.goodsMemo}
							</div>
						</DIV>

						<DIV class=comm_answer>

							<DIV id=total_comm>
								<DIV class=total_body>
									<DIV class=people_average>
										
			                           暂时没有任何评论！
			                   
									</DIV>
									<DIV class=write_comm>
										<span id=reviewTipa onclick="gotopubcomment();"> <IMG
												title=写评论 src="<c:url value="/jsps/front/images/login/button_write_comm.gif"/>"
												border=0> </span>
									</DIV>
								</DIV>
								<DIV class=empty_clear_left></DIV>
							</DIV>
						</DIV>
					</DIV>
				</DIV>
               </c:if>
               <c:if test="${empty good}">
                   <div>没有找到相关的商品</div>
               </c:if>
			</div>
		</div>
		</div>
	</body>
</html>
